﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace Delay
{
    public class ScoreDetail : DependencyObject, INotifyPropertyChanged
    {
        private int _result;
        public int Result
        {
            get
            {
                return _result;
            }
            set
            {
                if (_result != value)
                {
                    _result = value;
                    NotifyPropertyChanged("Result");
                }
            }
        }
        public string ResultMsg
        {
            get;
            set;
        }
        public int IsLogo
        {
            get;
            set;
        }//

        public int Sc1
        {
            get;
            set;
        }//
        public int Sc2
        {
            get;
            set;
        }//
        public int Sc3
        {
            get;
            set;
        }//
        public int Sc4
        {
            get;
            set;
        }//
        public int Sc5
        {
            get;
            set;
        }//
        private int _totalScore;
        public int TotalScore
        {
            get
            {
                return _totalScore;
            }
            set
            {
                if (_totalScore != value)
                {
                    _totalScore = value;
                    NotifyPropertyChanged("TotalScore");
                }
            }
        }//
        public string GetPhoneInfoUrl(string topicid)
        {
            //这个函数不同的类一般要改写
            string url = QueryXml.PhoneTypeScoreDetailUrl;
            url += ("imei=" + QueryXml.imei);
            url += ("&phonename=" + QueryXml.phonename);
            url += ("&phonevs=" + QueryXml.phonevs);
            url += ("&phonevsno=" + QueryXml.phonevsno);
            url += ("&keyvalue=" + QueryXml.keyvalue);
            url += ("&channelkey=" + QueryXml.channelkey);
            if (topicid != null) url += ("&pid=" + topicid.ToString());
            return url;
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
